/*
 *  Copyright 2010 UPF Telecos 4th group G.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */

package edu.upf.network;

import edu.upf.messages.GenericMessage;
import java.io.File;
import org.jivesoftware.smack.Roster;
import org.jivesoftware.smack.RosterEntry;

/**
 * Interface that shows generic the network functionalities
 * @author asustatil
 */
public interface InstantMessage {


    /**
     * Logouts the conection with the server
     * @return
     */
    public boolean logout();


    /**
     * Logs the user onto the server with the associated resource
     * @param name
     * @param pass
     * @param resource
     * @return
     */
    public boolean login(String name, String pass, String resource);


    /**
     * Gets the customized name of a contact instead of 'user@server'
     * @param re
     * @return
     */
    public String getNameShown(RosterEntry re);

    /**
     * Returns the roster (list of buddies) associated with the client
     * @return
     */
    public Roster getRoster();

    /**
     * Sends a chat message to the destination parameter
     * @param dest
     * @param text
     */
    public void sendChatMessage(String dest, String text);

    /**
     * Sends a generic message
     * @param msg 
     */
    public void sendGenericMessage(GenericMessage msg);

    /**
     * Sends a media file initiating a file transfer between clients
     * @param media
     * @param dest
     * @param descr 
     */
    public void sendMedia(File media, String dest, String descr);

}
